package cn.com.shadowless.xinning.view.activity;


import android.content.Intent;
import android.util.Log;
import android.widget.FrameLayout;

import com.mengpeng.mphelper.ToastUtils;

import butterknife.BindView;
import cn.com.shadowless.xinning.MyApplication;
import cn.com.shadowless.xinning.R;
import cn.com.shadowless.xinning.callback.RequestCallBack;
import cn.com.shadowless.xinning.model.RequestResult;
import cn.com.shadowless.xinning.model.login.LoginInfo;
import cn.com.shadowless.xinning.presenter.LoginPresenter;
import cn.com.shadowless.xinning.utils.FragmentUtils;
import cn.com.shadowless.xinning.utils.PreferencesUtils;
import cn.com.shadowless.xinning.utils.ProgressDialogUtils;
import cn.com.shadowless.xinning.view.BaseActivity;
import cn.com.shadowless.xinning.view.fragment.BillFragment;
import cn.jpush.android.api.JPushInterface;

/**
 * The type Order activity.
 *
 * @author sHadowLess
 */
public class OrderActivity extends BaseActivity {

    private final String TAG = OrderActivity.class.getSimpleName();

    /**
     * The Order fragment.
     */
    @BindView(R.id.order_fragment)
    FrameLayout orderFragment;

    private BillFragment billFragment = new BillFragment();
    private long justTime = 0;

    @Override
    protected int setLayout() {
        return R.layout.activity_order;
    }

    @Override
    protected void setData() {
        FragmentUtils.replaceFragment(fragmentManager, R.id.order_fragment, billFragment);
    }

    @Override
    public void onBackPressed() {
        if ((System.currentTimeMillis() - justTime) > 2000) {
            ToastUtils.onInfoShowToast("再次点击退出应用");
            justTime = System.currentTimeMillis();
        } else {
            finish();
        }
    }
}